home *** CD-ROM | disk | FTP | other *** search
- /* */
-
- call rxmuiopt("DEBUGMODE SHOWERR")
-
- listview.list="DIRL"
- dirl.class="dirlist"
- dirl.directory=programname("PATH")
- dirl.test="1"x
- dirl.format=""
- listview.weight=1000
- listview.frame="READLIST"
- res=NewObj("LISTVIEW","LISTVIEW")
- if res~=0 then call err(res)
-
- app.Title="DirList"
- app.Version="$VER: DirList 1.0 (22.11.99)"
- app.Copyright="©1999, alfie"
- app.Author="alfie"
- app.Description="DirList"
- app.Base="EXAMPLE"
- app.SubWindow="WIN"
- win.Title="Dirlist"
- win.Contents="MGROUP"
- mgroup.0="LISTVIEW"
- mgroup.1=String("DIR",,Programname("PATH"))
- mgroup.4=hvspace()
-
- res=NewObj("APPLICATION","APP")
- if res~=0 then call err(res)
-
- res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
- if res~=0 then call err(res)
-
- res=Notify("DIR","NEWCONTENTS","EVERYTIME","dirl","SET","directory","TRIGGERVALUE")
- res=Notify("LISTVIEW","DOUBLECLICK","EVERYTIME","APP","RETURNID")
- /*res=Notify("dirl","DIRECTORY","EVERYTIME","APP","RETURNID")*/
-
- if res~=0 then call err(res)
-
- res=set("WIN","OPEN",1)
- if res~=0 then call err(res)
-
- s=0
- do forever
- call handle("APP","H",s)
- do i=0 to h.num-1
- if h.i="QUIT" then exit
- if h.i="dirl" then do
- call getattr("DIRL","DIRECTORY","D")
- call pragma("D",d)
- say d
- end
- if h.i="LISTVIEW" then do
- res=DoMethod("dirl","GETENTRY","ACTIVE","A")
- if res~=0 then call err(res)
- say a.name a.entrytype pragma("D")
- if a.entrytype>0 then do
- call pragma("D",a.name)
- call set("dirl","DIRECTORY",pragma("D"))
- call set("DIR","CONTENTS",pragma("D"))
- end
- end
- end
- s=Wait(or(h.signals,2**12))
- if and(s,2**12)~=0 then exit
- end
- exit
-
- err: procedure expose sigl
- parse arg res
- say getrxmuistring(res) "in line" sigl-1
- exit
-
- makeToggle: procedure
- parse arg name,text,state,cc
- return ToggleButton(name,text,state)
- b.Contents=text
- b.inputmode="TOGGLE"
- b.showselstate=1
- b.selected=state
- b.font="BUTTON"
- b.frame="BUTTON"
- b.background="BUTTONBACK"
- b.TextHiChar=cc
- b.ControlChar=cc
- b.TextHiCharIdx='_'
- res=newobj("TEXT",name,"B")
- if res then call esci(res)
- return name
-